﻿#pragma once
#include "Material.h"
#include "ShaderProgram.h"

class FOutlineMaterial
	: public FMaterial
{
public:
	bool Init() override
	{
		InitShaderWayType = EInitShaderWayType::SrcCode;

		if(!FMaterial::Init())
		{
			return false;
		}

		Shader->SetLightingModel(ELightingModel::None);

		return true;
	}

	void Use() override
	{
		FMaterial::Use();
	}

	const std::string& GetVsSrcCode() const override  // NOLINT(modernize-use-nodiscard)
	{
		static std::string Code = R"(
			#version 410 core 
			
			layout (location = 0) in vec3 aPos;
			layout (location = 1) in vec3 aColor;
			layout (location = 2) in vec2 aTexCoord;
			
			uniform mat4 model;
			uniform mat4 view;
			uniform mat4 projection;
			
			void main()
			{
			    gl_Position = projection *  view * model * vec4(aPos, 1.0);
			}
		)";
		return Code;
	}

	const std::string& GetFsSrcCode() const override  // NOLINT(modernize-use-nodiscard)
	{
		static std::string Code = R"(

			#version 410 core
			out vec4 FragColor;

			void main()
			{
			    FragColor = vec4(0.04, 0.28, 0.26, 1.0);
			}

		)";
		return Code;
	}
};
